<?php


  define('IN_ECS', true);
  
  require_once 'dragon/util/common.php';
  require_once 'dragon/util/smarty_utils.php';
  require_once 'dragon/vegetables/service/vegetables_service.php';

  $vegetablesService = new VegetablesService();

  $action = trim($_REQUEST['act']);
  
  if($action == 'vegetable_list'){
  	$cateId = isset($_REQUEST['cate_id']) ? trim($_REQUEST['cate_id']) : -1;
  	$page = isset($_REQUEST['page']) ? trim($_REQUEST['page']) : 1;
  	
  	$result = $vegetablesService->getVegetablesListByCateId($cateId, $page);
  	
  	$content = $smarty->fetch('vegetables/vegetables_list.inc');
  	
  	exit(json_encode(array('content'=>$content)));
  }
  
  
?>